<div id="content">
    <?php
    if (is_array($items) && count($items)) {
        foreach ($items as $item) {
            $registry = new JRegistry;
            $registry->loadString($item->file);
            $item->file = $registry->toArray();
            $thumb = "";
            if(isset($item->file['image']) && $item->file['image']){
                $thumb = JUri::base() . DS . "images/{$directory}{$item->file['image']}";
            } else {
                $thumb = "images/fixed/0170c.jpg";
            }
            $link = JRoute::_("index.php?option=com_works&view=work&Itemid=130&cat_id={$item->category_id}&id=" . (int)$item->id);
            ?>
            <div class="item">
                <div class="info_box">
                    <div class="caption">
                        <a class="title" href="<?php echo $link; ?>"><?php echo $item->title; ?></a>
                        <p><?php echo trimstr($item->short_desc,100); ?></p>
                        <div class="link_btn"><a href="<?php echo $link; ?>"><?php echo JText::_('View detail'); ?></a></div>
                    </div>
                    <div class="img"><a href="<?php echo $link; ?>"><img src="timthumb.php?src=<?php echo $thumb; ?>&w=317&h=211"  /></a></div>
                </div>
            </div>
            <?php
        }
    }
    ?>
    <br class="clear" />

</div>
<div class="more_project">
    <a href="<?php echo JRoute::_('index.php?option=com_works&view=works&Itemid=130'); ?>"><?php echo JText::_('VIEWMOREPROJECTS');?></a>
</div>